home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2010 April / PCWorld0410.iso / pluginy Firefox / 1833 / 1833.xpi / chrome / yoono.jar / content / yoono / bookmarks / placesOverlay.js < prev    next >
Text File  |  2009-12-16  |  1KB  |  43 lines

  1. /*
  2.  * placesOverlay.js
  3.  *
  4.  */
  5.  
  6. Components.utils.import("resource://yoono/yoonoService.js");
  7. Components.utils.import("resource://yoono/yoonoBkmSync.js");
  8. Components.utils.import("resource://yoono/yoonoLog.js");
  9. const YNPREFBRANCH = Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefService).getBranch("extensions.yoono.");
  10. Components.utils.import("resource://yoono/yoonoDialogs.js");
  11.  
  12. var privateMarker = 'yoonoPrivate';
  13.  
  14.  
  15. function log(m) {
  16.   var console = Components.classes["@mozilla.org/consoleservice;1"].getService(Components.interfaces.nsIConsoleService);
  17.   console.logStringMessage(m);
  18. }
  19.  
  20.  
  21.  
  22. function init() {
  23.   
  24.     // Overload nsITreeView to display private icons
  25.     PlacesTreeView.prototype.officialGetCellProperties = PlacesTreeView.prototype.getCellProperties;
  26.     PlacesTreeView.prototype.getCellProperties = function (aRow, aColumn, aProperties) {
  27.       
  28.         this.officialGetCellProperties(aRow, aColumn, aProperties);
  29.         
  30.         var node = this._visibleElements[aRow];
  31.         if (node && node.itemId && YOONO_BKM.isPrivate(node.itemId))
  32.           aProperties.AppendElement(this._getAtomFor(privateMarker));
  33.         
  34.     };
  35.     
  36.     // Overload controler to display yoono bkm menus
  37.     attachYoonoBkmMenu();
  38.   
  39. }
  40.  
  41.  
  42. window.addEventListener("load", function() { init(); }, false);
  43.